function getSliderSettings(){return{slidesToShow:1,slidesToScroll:1,fade:!0,infinite:!1,adaptiveHeight:!1,asNavFor:".product__media-sublist",prevArrow:`
`,nextArrow:``,responsive:[{breakpoint:990,settings:{adaptiveHeight:!0}}]}}function getSubSliderProductSettings(slider){return{slidesToShow:7,slidesToScroll:1,arrows:!1,asNavFor:slider?slider[0]:".product__media-list",focusOnSelect:!0,vertical:!0,verticalSwiping:!1,autoplay:!1,infinite:!1}}function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe"))}document.querySelectorAll('[id^="Details-"] summary').forEach(summary=>{summary.setAttribute("role","button"),summary.setAttribute("aria-expanded","false"),summary.nextElementSibling.getAttribute("id")&&summary.setAttribute("aria-controls",summary.nextElementSibling.id),summary.addEventListener("click",event2=>{event2.currentTarget.setAttribute("aria-expanded",!event2.currentTarget.closest("details").hasAttribute("open"))}),!summary.closest("header-drawer")&&summary.parentElement.addEventListener("keyup",onKeyUpEscape)});function onKeyUpEscape(event2){if(event2.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event2.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.setAttribute("aria-expanded",!1),summaryElement.focus()}const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event2=>{event2.target!==container&&event2.target!==last&&event2.target!==first||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event2){event2.code.toUpperCase()==="TAB"&&(event2.target===last&&!event2.shiftKey&&(event2.preventDefault(),first.focus()),(event2.target===container||event2.target===first)&&event2.shiftKey&&(event2.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus()}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=new Event("change",{bubbles:!0}),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)));var eventList=["paste","input"];for(event of eventList)this.input.addEventListener(event,function(e){/^0*?[1-9]\d*$/.test(e.currentTarget.value)||e.currentTarget.value===""?e.currentTarget.value:e.currentTarget.value=1});this.input.addEventListener("focusout",function(e){e.currentTarget.value===""&&(e.currentTarget.value=1)})}onButtonClick(event2){event2.preventDefault();const previousValue=this.input.value;event2.target.name==="plus"?this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-input",QuantityInput);function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}const serializeForm=form=>{const obj={},formData=new FormData(form);for(const key of formData.keys())obj[key]=formData.get(key);return JSON.stringify(obj)};function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i=0,count=selector.options.length;i0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length==0)this.provinceContainer.style.display="none";else{for(var i=0;isummary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button").forEach(button=>{this.querySelector(".header__localization-button")!==button&&this.querySelector(".header__localization-lang-button")!==button&&button.addEventListener("click",this.onCloseButtonClick.bind(this))})}addAccessibilityAttributes(summaryElements){summaryElements.forEach(element=>{element.setAttribute("role","button"),element.setAttribute("aria-expanded",!1),element.setAttribute("aria-controls",element.nextElementSibling.id)})}onKeyUp(event2){if(event2.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event2.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event2){const summaryElement=event2.currentTarget,detailsElement=summaryElement.parentNode,isOpen=detailsElement.hasAttribute("open");detailsElement===this.mainDetailsToggle?(isOpen&&event2.preventDefault(),isOpen?this.closeMenuDrawer(summaryElement):this.openMenuDrawer(summaryElement)):(trapFocus(summaryElement.nextElementSibling,detailsElement.querySelector("button")),setTimeout(()=>{detailsElement.classList.add("menu-opening")}))}openMenuDrawer(summaryElement){setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event2,elementToFocus=!1){event2!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(details=>{details.removeAttribute("open"),details.classList.remove("menu-opening")}),this.mainDetailsToggle.querySelector("summary").setAttribute("aria-expanded",!1),document.body.classList.remove(`overflow-hidden-${this.dataset.breakpoint}`),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle))}onFocusOut(event2){setTimeout(()=>{this.mainDetailsToggle.hasAttribute("open")&&!this.mainDetailsToggle.contains(document.activeElement)&&this.closeMenuDrawer()})}onCloseButtonClick(event2){const detailsElement=event2.currentTarget.closest("details");this.closeSubmenu(detailsElement)}closeSubmenu(detailsElement){detailsElement.classList.remove("menu-opening"),removeTrapFocus(),this.closeAnimation(detailsElement)}closeAnimation(detailsElement){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?window.requestAnimationFrame(handleAnimation):(detailsElement.removeAttribute("open"),detailsElement.closest("details[open]")&&trapFocus(detailsElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}openMenuDrawer(summaryElement){this.header=this.header||document.querySelector(".shopify-section-header"),this.borderOffset=this.borderOffset||this.closest(".header-wrapper").classList.contains("header-wrapper--border-bottom")?1:0,document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}}customElements.define("header-drawer",HeaderDrawer);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]').addEventListener("click",this.hide.bind(this)),this.addEventListener("click",event2=>{event2.target.nodeName==="MODAL-DIALOG"&&this.hide()}),this.addEventListener("keyup",event2=>{event2.code.toUpperCase()==="ESCAPE"&&this.hide()})}show(opener){this.openedBy=opener,document.body.classList.add("overflow-hidden"),this.setAttribute("open",""),this.querySelector(".template-popup")?.loadContent(),trapFocus(this,this.querySelector('[role="dialog"]'))}hide(){document.body.classList.remove("overflow-hidden"),this.removeAttribute("open"),removeTrapFocus(this.openedBy),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button?.addEventListener("click",()=>{document.querySelector(this.getAttribute("data-modal"))?.show(button)})}}customElements.define("modal-opener",ModalOpener);class DeferredMedia extends HTMLElement{constructor(){super(),this.querySelector('[id^="Deferred-Poster-"]')?.addEventListener("click",this.loadContent.bind(this)),this.getAttribute("data-autoplay")&&this.loadContent()}loadContent(){if(!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0),window.pauseAllMedia();const videoObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){if(this.getAttribute("data-autoplay")){let playPromise=entry.target.play();playPromise!==void 0&&playPromise.then(_=>{}).catch(error=>{})}}else entry.target.pause()})}),deferredElement=this.appendChild(content.querySelector("video, model-viewer, iframe"));if(deferredElement.nodeName=="VIDEO"||deferredElement.nodeName=="IFRAME")if(this.classList.contains("video-section__media")){let playPromise=deferredElement.play();playPromise!==void 0&&playPromise.then(_=>{}).catch(error=>{}),videoObserver.observe(deferredElement)}else deferredElement.play()}}}customElements.define("deferred-media",DeferredMedia);class SliderComponent extends HTMLElement{constructor(){if(super(),this.slider=this.querySelector(".slider"),this.sliderItems=this.querySelectorAll(".slider__slide"),this.pageCount=this.querySelector(".slider-counter--current"),this.pageTotal=this.querySelector(".slider-counter--total"),this.prevButton=this.querySelector('button[name="previous"]'),this.nextButton=this.querySelector('button[name="next"]'),!this.slider||!this.nextButton)return;new ResizeObserver(entries=>this.initPages()).observe(this.slider),this.slider.addEventListener("scroll",this.update.bind(this)),this.prevButton.addEventListener("click",this.onButtonClick.bind(this)),this.nextButton.addEventListener("click",this.onButtonClick.bind(this))}initPages(){!this.sliderItems.length!==0&&(this.slidesPerPage=Math.floor(this.slider.clientWidth/this.sliderItems[0].clientWidth),this.totalPages=this.sliderItems.length-this.slidesPerPage+1,this.update())}update(){!this.pageCount||!this.pageTotal||(this.currentPage=Math.round(this.slider.scrollLeft/this.sliderItems[0].clientWidth)+1,this.currentPage===1?this.prevButton.setAttribute("disabled",!0):this.prevButton.removeAttribute("disabled"),this.currentPage===this.totalPages?this.nextButton.setAttribute("disabled",!0):this.nextButton.removeAttribute("disabled"),this.pageCount.textContent=this.currentPage,this.pageTotal.textContent=this.totalPages)}onButtonClick(event2){event2.preventDefault();const slideScrollPosition=event2.currentTarget.name==="next"?this.slider.scrollLeft+this.sliderItems[0].clientWidth:this.slider.scrollLeft-this.sliderItems[0].clientWidth;this.slider.scrollTo({left:slideScrollPosition})}}customElements.define("slider-component",SliderComponent);class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange)}onVariantChange(){this.updateOptions(),this.updateMasterId(),this.toggleAddButton(!0,"",!1),this.updatePickupAvailability(),this.updateVariantStatuses(),this.currentVariant?(this.updateMedia(),this.updateMediaSub(),this.updateURL(),this.updateVariantInput(),this.renderProductInfo()):(this.toggleAddButton(!0,"",!0),this.setUnavailable())}updateOptions(){const fieldsets=Array.from(this.querySelectorAll(".js-radio-colors"));this.options=Array.from(this.querySelectorAll("select"),select=>select.value).concat(fieldsets.map(fieldset=>Array.from(fieldset.querySelectorAll("input")).find(radio=>radio.checked).value))}updateMasterId(){(this.variantData||this.querySelector('[type="application/json"]'))&&(this.currentVariant=this.getVariantData().find(variant=>(this.options.sort(),variant.options.sort(),!variant.options.map((option,index)=>this.options[index]===option).includes(!1))))}updateMedia(){if(!this.currentVariant||!this.currentVariant?.featured_media)return;const newMedia=document.querySelector(`[data-media-id="${this.dataset.section}-${this.currentVariant.featured_media.id}"]`);if($(".product__media-list").slick("unslick"),!newMedia)return;const parent=newMedia.parentElement;parent.prepend(newMedia),window.setTimeout(()=>{parent.scroll(0,0)}),$(".product__media-list").slick(getSliderSettings()),$(".product__media-list").on("afterChange",function(event2,slick,currentSlide,nextSlide){window.pauseAllMedia()})}updateMediaSub(){if(!this.currentVariant||!this.currentVariant?.featured_media)return;const newMediaSub=document.querySelector(`[data-media-sub-id="${this.dataset.section}-${this.currentVariant.featured_media.id}"]`);if($(".product__media-sublist").slick("unslick"),!newMediaSub)return;const parentSub=newMediaSub.parentElement;parentSub.prepend(newMediaSub),window.setTimeout(()=>{parentSub.scroll(0,0)}),$(".product__media-sublist").slick(getSubSliderProductSettings())}updateURL(){if(!this.classList.contains("variant-selects--quick-view")&&!this.classList.contains("featured-product-radios")){if(!this.currentVariant)return;window.history.replaceState({},"",`${this.dataset.url}?variant=${this.currentVariant.id}`),document.querySelector(".custom-request-form #ContactForm-ProductUrl")&&(document.querySelector(".custom-request-form #ContactForm-ProductUrl").value=document.location.href)}}updateVariantInput(){document.querySelectorAll(`#product-form-${this.dataset.section}, #product-form-installment`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updateVariantStatuses(){const selectedOptionOneVariants=this.variantData.filter(variant=>this.querySelector(":checked").value===variant.option1),inputWrappers=[...this.querySelectorAll(".product-form__input")];inputWrappers.forEach((option,index)=>{if(index===0)return;const optionInputs=[...option.querySelectorAll('input[type="radio"], option')],previousOptionSelected=inputWrappers[index-1].querySelector(":checked").value,availableOptionInputsValue=selectedOptionOneVariants.filter(variant=>variant.available&&variant[`option${index}`]===previousOptionSelected).map(variantOption=>variantOption[`option${index+1}`]);this.setInputAvailability(optionInputs,availableOptionInputsValue)})}setInputAvailability(listOfOptions,listOfAvailableOptions){listOfOptions.forEach(input=>{listOfAvailableOptions.includes(input.getAttribute("value"))?input.tagName==="OPTION"?input.innerText=input.getAttribute("value"):input.tagName==="INPUT"&&input.classList.remove("disabled"):input.tagName==="OPTION"?input.innerText=window.variantStrings.unavailable_with_option.replace("[value]",input.getAttribute("value")):input.tagName==="INPUT"&&input.classList.add("disabled")})}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");pickUpAvailability&&(this.currentVariant?.available?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.removeAttribute("available"),pickUpAvailability.innerHTML=""))}renderProductInfo(){fetch(`${this.dataset.url}?variant=${this.currentVariant.id}§ion_id=${this.dataset.section}`).then(response=>response.text()).then(responseText=>{const id=`price-${this.dataset.section}`,html=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(id),source=html.getElementById(id);source&&destination&&(destination.innerHTML=source.innerHTML),document.getElementById(`price-${this.dataset.section}`)?.classList.remove("visibility-hidden");const skuSource=html.getElementById(`Sku-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),skuDestination=document.getElementById(`Sku-${this.dataset.section}`),inventorySource=html.getElementById(`Inventory-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),inventoryDestination=document.getElementById(`Inventory-${this.dataset.section}`);source&&destination&&(destination.innerHTML=source.innerHTML),inventorySource&&inventoryDestination&&(inventoryDestination.innerHTML=inventorySource.innerHTML),skuSource&&skuDestination&&(skuDestination.innerHTML=skuSource.innerHTML,skuDestination.classList.toggle("visibility-hidden",skuSource.classList.contains("visibility-hidden"))),document.querySelector(".custom-request-form")&&(document.querySelector(".custom-request-form #ContactForm-ProductSKU")&&skuSource?document.querySelector(".custom-request-form #ContactForm-ProductSKU").value=skuSource.innerText.trim():document.querySelector(".custom-request-form #ContactForm-ProductSKU")&&(document.querySelector(".custom-request-form #ContactForm-ProductSKU").value=""),document.querySelector(".custom-request-form #ContactForm-ProductInventory")&&inventorySource?document.querySelector(".custom-request-form #ContactForm-ProductInventory").value=inventorySource.innerText.trim():document.querySelector(".custom-request-form #ContactForm-ProductInventory")&&(document.querySelector(".custom-request-form #ContactForm-ProductInventory").value=""));const price=document.getElementById(`price-${this.dataset.section}`);price&&price.classList.remove("visibility-hidden"),inventoryDestination&&inventoryDestination.classList.toggle("visibility-hidden",inventorySource.innerText===""),this.toggleAddButton(!this.currentVariant.available,window.variantStrings.soldOut)})}toggleAddButton(disable=!0,text,modifyClass=!0){const addButton=document.getElementById(`product-form-${this.dataset.section}`)?.querySelector('[name="add"]');addButton&&(disable?(addButton.setAttribute("disabled",!0),text&&(addButton.textContent=text)):(addButton.removeAttribute("disabled"),addButton.textContent=window.variantStrings.addToCart))}setUnavailable(){const addButton=document.getElementById(`product-form-${this.dataset.section}`)?.querySelector('[name="add"]');if(!addButton)return;addButton.textContent=window.variantStrings.unavailable,document.getElementById(`price-${this.dataset.section}`)?.classList.add("visibility-hidden");const inventory=document.getElementById(`Inventory-${this.dataset.section}`);inventory&&inventory.classList.add("visibility-hidden")}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}}customElements.define("variant-selects",VariantSelects);class VariantRadios extends VariantSelects{constructor(){super()}setInputAvailability(listOfOptions,listOfAvailableOptions){listOfOptions.forEach(input=>{listOfAvailableOptions.includes(input.getAttribute("value"))?input.classList.remove("disabled"):input.classList.add("disabled")})}updateOptions(){const fieldsets=Array.from(this.querySelectorAll("fieldset"));this.options=fieldsets.map(fieldset=>Array.from(fieldset.querySelectorAll("input")).find(radio=>radio.checked).value)}}customElements.define("variant-radios",VariantRadios),function(){const header=()=>{const submenuDetails=document.querySelectorAll(".header__submenu li details");submenuDetails.forEach(targetDetail=>{targetDetail.addEventListener("click",()=>{submenuDetails.forEach(detail=>{detail!==targetDetail&&detail.removeAttribute("open")})})})};document.addEventListener("shopify:section:load",header),header()}();class ProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),!this.querySelector("slideshow-component")&&this.classList.contains("complementary-products")&&this.remove(),html.querySelector(".grid__item")&&this.classList.add("product-recommendations--loaded")}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("product-recommendations",ProductRecommendations),window.onload=function(){const coolimageScript=document.querySelectorAll('script[src*="cool-image-magnifier"]');let coolimageGallery=document.querySelector(".product__media-wrapper");coolimageScript.length>0&&coolimageGallery&&coolimageGallery.classList.add("cool-image-custom")};
//# sourceMappingURL=/cdn/shop/t/13/assets/global.js.map?v=91631519478693952271735276344